import React from 'react'
import { BaseListPage, IBaseListPageState, IBaseListPageProps, columnRenders, UdPage, UdPageHeader, UdTable, UdToolbar, UdFilter, UdModal, http, BaseDetailPage, IBaseDetailPageState, IBaseDetailPageProps } from '@/lib';
import '../QuotaAdjustment/Secondary/comm.css'
import { Tabs, Input, Modal } from 'antd';
import _ from 'lodash';
import apis from '@/apis/AboutQuota';

export default class QuotaAdjustmentSecondaryList extends BaseListPage<QuotaAdjustmentSecondaryListProps, QuotaAdjustmentSecondaryListState>{

  protected useConditionsField = true

  constructor(props) {
    super(props)
    this.state = {
      title: "关联订单",
      rowKey: (record, index) => index + '',
      queryApi: (params) => {
        let businessItemNumber = props.match.params.id
        params.conditions = { ...params.conditions, businessItemNumber }
        return http.post(apis.getQuotaOrderPage, params)
      },
      columns: [
        {
          title: "序号",
          dataIndex: "no",
          render: (text, record, index: number) => index + 1
        },
        ['订单抬头申请编号', 'orderTopApplyCode'],
        ['订单行项目', 'orderNum'],
        ['客户名称', 'dealerName'],
        ['物料分类名称', 'groupName'],
        ['物料名称', 'matName'],
        ['数量', 'skuNum'],
        ['记录单位', 'recordUnit'],
      ],
      onBack: this.props.history.goBack,
    }
  }

}

interface QuotaAdjustmentSecondaryListState extends IBaseListPageState {
  
}

interface QuotaAdjustmentSecondaryListProps extends IBaseListPageProps<{
  id: string
}> {

}